package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.LabReqdetailDetailDto;
import com.ysd.lis.service.lab.LabReqdetailDelService;
import com.ysd.lis.service.lab.LabReqdetailService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 申请明细表 前端控制器
 * </p>
 *
 * @author Bai
 * @since 2023-12-26
 */
@RestController
@RequestMapping("/api/reqdetail")
public class LabReqdetailController extends BaseController {
    @Autowired
    LabReqdetailService labReqdetailService;

    @ApiOperation("根据条码号查询项目明细")
    @GetMapping("/getDetailByBarcode")
    public Result getDetailByBarcode(String reqNo) {
        return labReqdetailService.getDetailByBarcode(reqNo);
    }
    @Autowired
    private LabReqdetailService rptdetailService;

    @ApiOperation("获取项目费用明细")
    @GetMapping("/findReqDetailByReqNo")
    public Result findReqDetailByReqNo(String reqNo) {
        return rptdetailService.findReqDetailByReqNo(reqNo);
    }

    @ApiOperation("获取费用项目统计数量")
    @GetMapping("/findReqDetailTotalCountByReqNo")
    public Result findReqDetailTotalCountByReqNo(String reqNo,String rptGroup) {
        return rptdetailService.findReqDetailTotalCountByReqNo(reqNo,rptGroup);
    }

    @Autowired
    private LabReqdetailDelService labReqdetailDelService;
    @ApiOperation("批量添加")
    @PostMapping("/batchAddReqDetailList")
    public Result batchAddReqDetailList(@RequestBody LabReqdetailDetailDto dto) {
        return labReqdetailDelService.batchAddReqDetailList(dto);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDetelReqDetailList")
    public Result batchDetelReqDetailList(@RequestBody LabReqdetailDetailDto dto) {
        return labReqdetailDelService.batchDetelReqDetailList(dto);
    }

}
